package phone.qyg.com.qyg.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 作者：lblbh on 2017/12/2 16:17
 * 邮箱：lanbuhan@163.com
 * 功能：绑定用户
 */
public class Third implements Parcelable {

    /**
     “unionid”: 11   //qq登录唯一标识ID（必填）
     “bind_type”:  1    //绑定类型：1-已有用户绑定，2-新用户注册
     “login_type”:  1  //登录类型：1-qq，2-wechat
     “login_name”:”lbh”         //登录名
     “mobile”:”18701581924”      //手机号
     “password”:”123456”       //密码
     “mobile_code”:”1234”      //短信验证码（新用户绑定）
     “nick_name”:”张三”        //用户昵称
     “sexName”:”男”           //性别
     “head_photo”:
     ”http://domain:port/data/profile/2017/03/10/jpg/sd323w3-23dd23.jpg”, // 头像


     “user_id”: “1000”,//用户id
     “access_token”: “0de94fae-01f3-49ac-ba4d-c2c070f0522d”,
     “user_name”: “张三”,//真实名
     “login_name”: “test”,//登录名
     “token_time”:1209600,
     “fixHeadPhoto”:
     ”http://domain:port/data/profile/2017/03/10/jpg/sd323w3-23dd23.jpg”,
     “mobile”:”18700000000”,
     “email”:”12328746@qq.com”

     */
    public int bind_type;
    public int login_type;
    public String mobile;
    public String unionid;
    public String sexName;
    public String password;
    public String nick_name;
    public String head_photo;
    public String login_name;
    public String mobile_code;

    public Third() {}

    public Third(int login_type, String head_photo, String nick_name, String sexName, String unionid) {
        this.login_type = login_type;
        this.head_photo = head_photo;
        this.nick_name = nick_name;
        this.sexName = sexName;
        this.unionid = unionid;
    }

    @SuppressWarnings("unchecked")
    public Third(Parcel in) {
        bind_type = in.readInt();
        login_type = in.readInt();
        mobile = in.readString();
        unionid = in.readString();
        sexName = in.readString();
        password = in.readString();
        nick_name =in.readString();
        head_photo =in.readString();
        login_name =in.readString();
        mobile_code =in.readString();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(bind_type);
        dest.writeInt(login_type);
        dest.writeString(mobile);
        dest.writeString(unionid);
        dest.writeString(sexName);
        dest.writeString(password);
        dest.writeString(nick_name);
        dest.writeString(head_photo);
        dest.writeString(login_name);
        dest.writeString(mobile_code);

    }

    public static final Parcelable.Creator<Third> CREATOR = new Creator<Third>() {
        @Override
        public Third[] newArray(int size) {
            return new Third[size];
        }

        @Override
        public Third createFromParcel(Parcel in) {
            return new Third(in);
        }
    };

}
